package practice;

import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

public class practice09 {

    /**
     * 添加逗号
     */
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        char[] ch = in.next().toCharArray();
        Stack<Character> stack = new Stack<>();
        int count = 0;
        for (int i = ch.length - 1; i >= 0; ) {
            if (count < 3) {
                stack.push(ch[i]);
                count++;
                i--;
            }
            if (count == 3 && i != -1) {
                stack.push(',');
                count = 0;
            }
        }
        while (!stack.isEmpty()) {
            System.out.print(stack.pop());
        }
    }

    /**
     * 跳台阶
     * @param args
     */
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if (n == 1 || n == 2) {
            System.out.println(n);
            return;
        }
        int[] dp = new int[n + 1];
        dp[1] = 1; dp[2] = 2;
        for (int i = 3; i <= n; i++) {
            dp[i] = dp[i - 1] + dp[i - 2];
        }
        System.out.println(dp[n]);
    }

    /**
     *扑克牌顺子
     */
    public boolean IsContinuous (int[] numbers) {
        boolean[] hash = new boolean[14];
        int maxVal = 0, minVal = 14;
        for (int x : numbers) {
            if (x != 0) {
                if (hash[x] == true) return false;
                hash[x] = true;
                maxVal = Math.max(maxVal, x);
                minVal = Math.min(minVal, x);
            }
        }
        return maxVal - minVal <= 4;
    }

}
